package db

import (
	"database/sql"
)

type DbConnect struct {
	dsn     string
	connect *sql.DB
}

func Open(driver, dsn string) *DbConnect {
	c := &DbConnect{}
	DB, e := sql.Open(driver, dsn)
	if e != nil {
		panic(e)
	}
	c.dsn = dsn
	c.connect = DB
	return c
}

func (c *DbConnect) Connect() *sql.DB {
	return c.connect
}
